<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<head>
    <title>社交平台</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
</head>
<jsp:include page="/views/header.jsp"/>

<div class="container mt-4">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <h5>发布新日志</h5>
                </div>
                <div class="card-body">
                    <form action="${pageContext.request.contextPath}/post/create" method="post" enctype="multipart/form-data">
                        <div class="mb-3">
                            <textarea class="form-control" name="content" rows="5" placeholder="分享你的想法..." required></textarea>
                        </div>
                        <div class="mb-3">
                            <label for="visibility" class="form-label">可见范围</label>
                            <select class="form-select" id="visibility" name="visibility">
                                <option value="public">公开</option>
                                <option value="friends">仅好友可见</option>
                                <option value="private">仅自己可见</option>
                            </select>
                        </div>
                        <div class="mb-3">
                            <label for="location" class="form-label">位置</label>
                            <input type="text" class="form-control" id="location" name="location" placeholder="可选">
                        </div>
                        <div class="mb-3">
                            <label for="images" class="form-label">上传图片</label>
                            <input type="file" class="form-control" id="images" name="images" multiple accept="image/*">
                        </div>
                        <div class="d-flex justify-content-end">
                            <a href="${pageContext.request.contextPath}/post/list" class="btn btn-outline-secondary me-2">取消</a>
                            <button type="submit" class="btn btn-primary">发布</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<jsp:include page="/views/footer.jsp"/>